home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_11_03 / 1103109a < prev    next >
Text File  |  1993-01-06  |  609b  |  33 lines

  1. // fv1.h - a dynamic vector of float (with a possibly
  2. // non-zero low-bound) using a subscripting object
  3.  
  4. #include <iostream.h>
  5. #include "fa1.h"
  6.  
  7. class float_vector : public float_array
  8.     {
  9. public:
  10.     float_vector(int lo = 0, int hi = 0);
  11.     float operator[](int i) const;
  12.     fa_index operator[](int i);
  13.     int low() const;
  14.     int high() const;
  15. private:
  16.     int _low;
  17.     };
  18.  
  19. inline float_vector::float_vector(int lo, int hi)
  20.     : _low(lo), float_array(hi - lo + 1)
  21.     { }
  22.  
  23. inline float_vector::low() const
  24.     {
  25.     return _low;
  26.     }
  27.  
  28. inline float_vector::high() const
  29.     {
  30.     return _low + length() - 1;
  31.     }
  32.  
  33.